package com.toKnow.model.vo;

import com.toKnow.model.entity.ArticleAnswer;
import com.toKnow.model.entity.ArticleComment;
import com.toKnow.model.entity.SourceAnswer;
import com.toKnow.model.entity.SourceComment;

import java.util.Date;

public class AnswerVo {
    private Integer author_id;
    private String author_name;
    private String content;
    private Integer like_times;
    private Date reply_date;
    private String avatar;

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    @Override
    public String toString() {
        return "AnswerVo{" +
                "author_id=" + author_id +
                ", author_name='" + author_name + '\'' +
                ", content='" + content + '\'' +
                ", like_times=" + like_times +
                ", reply_date=" + reply_date +
                '}';
    }

    public Integer getAuthor_id() {
        return author_id;
    }

    public void setAuthor_id(Integer author_id) {
        this.author_id = author_id;
    }

    public String getAuthor_name() {
        return author_name;
    }

    public void setAuthor_name(String author_name) {
        this.author_name = author_name;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getLike_times() {
        return like_times;
    }

    public void setLike_times(Integer like_times) {
        this.like_times = like_times;
    }

    public Date getReply_date() {
        return reply_date;
    }

    public void setReply_date(Date reply_date) {
        this.reply_date = reply_date;
    }

    public AnswerVo() {
    }

    public AnswerVo(Integer author_id, String author_name, String content, Integer like_times, Date reply_date) {
        this.author_id = author_id;
        this.author_name = author_name;
        this.content = content;
        this.like_times = like_times;
        this.reply_date = reply_date;
    }
    public AnswerVo(ArticleAnswer articleAnswer) {
        this.author_id = articleAnswer.getUserId();
        this.author_name = articleAnswer.getUserName();
        this.content = articleAnswer.getContent();
        this.like_times = articleAnswer.getLikeNumber();
        this.reply_date = articleAnswer.getAnswerDate();
        this.avatar=articleAnswer.getAvatar();
    }
    public AnswerVo(SourceAnswer sourceAnswer) {
        this.author_id = sourceAnswer.getUserId();
        this.author_name = sourceAnswer.getUserName();
        this.content = sourceAnswer.getContent();
        this.like_times = sourceAnswer.getLikeNumber();
        this.reply_date = sourceAnswer.getAnswerDate();
        this.avatar=sourceAnswer.getAvatar();
    }
}
